package com.salelogistics.basic.service.impl;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

import com.salelogistics.common.core.utils.DateUtils;
import com.salelogistics.system.api.domain.SysDept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.salelogistics.basic.mapper.BasRoutesMapper;
import com.salelogistics.basic.domain.BasRoutes;
import com.salelogistics.basic.service.IBasRoutesService;

/**
 * 线路Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-09
 */
@Service
public class BasRoutesServiceImpl implements IBasRoutesService 
{
    @Autowired
    private BasRoutesMapper basRoutesMapper;

    /**
     * 查询线路
     * 
     * @param routeId 线路主键
     * @return 线路
     */
    @Override
    public BasRoutes selectBasRoutesByRouteId(Long routeId)
    {
        return basRoutesMapper.selectBasRoutesByRouteId(routeId);
    }

    /**
     * 查询线路列表
     * 
     * @param basRoutes 线路
     * @return 线路
     */
    @Override
    public List<BasRoutes> selectBasRoutesList(BasRoutes basRoutes)
    {
        return basRoutesMapper.selectBasRoutesList(basRoutes);
    }



    /**
     * 新增线路
     * 
     * @param basRoutes 线路
     * @return 结果
     */
    @Override
    public int insertBasRoutes(BasRoutes basRoutes)
    {
        basRoutes.setCreateTime(DateUtils.getNowDate());
        return basRoutesMapper.insertBasRoutes(basRoutes);
    }

    /**
     * 修改线路
     * 
     * @param basRoutes 线路
     * @return 结果
     */
    @Override
    public int updateBasRoutes(BasRoutes basRoutes)
    {
        return basRoutesMapper.updateBasRoutes(basRoutes);
    }

    /**
     * 批量删除线路
     * 
     * @param routeIds 需要删除的线路主键
     * @return 结果
     */
    @Override
    public int deleteBasRoutesByRouteIds(Long[] routeIds)
    {
        return basRoutesMapper.deleteBasRoutesByRouteIds(routeIds);
    }

    /**
     * 删除线路信息
     * 
     * @param routeId 线路主键
     * @return 结果
     */
    @Override
    public int deleteBasRoutesByRouteId(Long routeId)
    {
        return basRoutesMapper.deleteBasRoutesByRouteId(routeId);
    }

    @Override
    public BasRoutes selectRouteIdByConditions(BasRoutes basRoutes) {
        return basRoutesMapper.selectRouteIdByConditions(basRoutes);
    }
}
